package com.ruoyi.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * 企业微信部门对象 sys_dept_enterprise
 *
 * @author ruoyi
 * @date 2025-03-04
 */

@TableName("sys_dept_enterprise")

public class SysDeptEnterprise extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Integer id;

    private String corpid;
    /**
     * 名称
     */
    @Excel(name = "名称")
    private String name;

    /**
     * 父级id
     */
    @Excel(name = "父级id")
    @JsonProperty("parentid")
    private Integer parentId;

    /**
     * 排序
     */
    @Excel(name = "排序")
    @JsonProperty("order")
    private Long weight;
    @TableField(exist = false)
    private List<SysDeptEnterprise> children = new ArrayList<SysDeptEnterprise>();

    public SysDeptEnterprise() {
    }

    public SysDeptEnterprise(Integer id, String corpid, String name, Integer parentId, Long weight, List<SysDeptEnterprise> children) {
        this.id = id;
        this.corpid = corpid;
        this.name = name;
        this.parentId = parentId;
        this.weight = weight;
        this.children = children;
    }

    public Integer getId() {
        return id;
    }

    public SysDeptEnterprise setId(Integer id) {
        this.id = id;
        return this;
    }

    public String getCorpid() {
        return corpid;
    }

    public SysDeptEnterprise setCorpid(String corpid) {
        this.corpid = corpid;
        return this;
    }

    public String getName() {
        return name;
    }

    public SysDeptEnterprise setName(String name) {
        this.name = name;
        return this;
    }

    public Integer getParentId() {
        return parentId;
    }

    public SysDeptEnterprise setParentId(Integer parentId) {
        this.parentId = parentId;
        return this;
    }

    public Long getWeight() {
        return weight;
    }

    public SysDeptEnterprise setWeight(Long weight) {
        this.weight = weight;
        return this;
    }

    public List<SysDeptEnterprise> getChildren() {
        return children;
    }

    public SysDeptEnterprise setChildren(List<SysDeptEnterprise> children) {
        this.children = children;
        return this;
    }
}
